<template>
  <div class="mainpart">
    <div class="loginbox">
      <i class="logo"></i>
      <div class="title">
        <div class="title-img"></div>
        <div class="online_reporting_text"></div>
      </div>
      <div class="content">
        <router-link tag="div" class="left-btn" :to="'/inform/'">
          <i></i>
          在线举报
        </router-link>
        <router-link tag="div" class="right-btn" :to="'/inquiry/'">
          <i></i>
          自助查询
        </router-link>
      </div>
      <div class="footer_tel">
        <i></i>
        举报电话
        <a class="tel" :href="'tel:' + sysset.phone">{{ sysset.phone }}</a>
      </div>
    </div>
  </div>
</template> 

<script>
export default {
  name: "index",
  data() {
    return {
      sysset: { phone: "" }
    };
  },
  created() {
    this.getSysset();
  },
  methods: {
    getSysset() {
      // var timestamp = Date.parse(new Date());
      // let getSysset = JSON.parse(localStorage.getItem("sysset"));
      // if (getSysset&&getSysset.getdata >= timestamp) {
      //   this.sysset = getSysset;
      // } else {
      this.$axios
        .get("api/report/getSysset")
        .then(res => {
          // res.data.result.sysset.getdata = timestamp + 3000000; //300秒
          this.sysset = res.data.result.sysset;
          console.log(this.sysset);
          // localStorage.setItem("sysset", JSON.stringify(this.sysset));

          console.log(res);
        })
        .catch(error => {
          console.log(error);
        });
      // }
    }
  }
};
</script> 
 

<style lang="stylus" scoped>
.mainpart {
  width: 100%;
  background: url('~@/assets/images/bg.png') center center no-repeat;
  background-size: 100% 100%;
  height: 100%;

  .loginbox {
    padding: 0.56rem 0.25rem 0;

    .logo {
      width: 100%;
      height: 1.5rem;
      display: block;
      background: url('~@/assets/images/logo.png') center center no-repeat;
      background-size: contain;
      margin-bottom: 0.05rem;
    }

    .title {
      text-align: center;
      color: #fff;
      margin-bottom: 0.3rem;

      .title-img {
        background: url('~@/assets/images/title.png') center center no-repeat;
        margin: 0.2rem 0 0.16rem;
        width: 100%;
        height: 0.28rem;
        background-size: contain;
      }

      .online_reporting_text {
        background: url('~@/assets/images/online_reporting_text.png') center center no-repeat;
        width: 100%;
        height: 0.36rem;
        background-size: contain;
      }
    }

    .content {
      height: 120px;

      .left-btn {
        float: left;
        height: 100px;
        width: 43%;
        border-radius: 8px;
        text-align: center;
        background: linear-gradient(#ed7f7f, #e86666);
        line-height: 50px;
        color: white;
        font-size: 20px;

        i {
          margin-top: 12px;
          width: 100%;
          height: 35px;
          display: block;
          background: url('~@/assets/images/online_inform.png') center center no-repeat;
          background-size: contain;
          position: relative;
          top: 4px;
        }
      }

      .right-btn {
        float: right;
        height: 100px;
        width: 43%;
        border-radius: 8px;
        text-align: center;
        background: linear-gradient(#f1b84e, #e99434);
        line-height: 50px;
        color: white;
        font-size: 20px;

        i {
          margin-top: 12px;
          width: 100%;
          height: 35px;
          display: block;
          background: url('~@/assets/images/online_inquire.png') center center no-repeat;
          background-size: contain;
          position: relative;
          top: 4px;
        }
      }
    }

    .footer_tel {
      background: rgba(255, 255, 255, 0.1);
      border-radius: 30px;
      padding: 10px 0;
      text-align: center;
      color: white;
      font-size: 18px;

      i {
        width: 20px;
        height: 20px;
        display: inline-block;
        background: url('~@/assets/images/tel.png') center center no-repeat;
        background-size: contain;
        position: relative;
        top: 4px;
      }

      .tel {
        color: white;
        font-size: 20px;
        font-weight: bold;
      }
    }
  }
}
</style>
